package com.rjxy.plansystemmanagement.service.impl;

import com.rjxy.plansystemmanagement.entity.RoomInformation;
import com.rjxy.plansystemmanagement.mapper.RoomMapper;
import com.rjxy.plansystemmanagement.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;


    @Override
    public List<RoomInformation> list() {
        return roomMapper.list();
    }

    @Override
    public void deleteRoom(Integer ID) {
        roomMapper.deleteRoom(ID);
    }

    @Override
    public void addRoom(RoomInformation roomInformation) throws ParseException {

        roomMapper.addRoom(roomInformation);
    }

    @Override
    public RoomInformation getRoomById(Integer ID) {
        return roomMapper.getRoomById(ID);
    }

    @Override
    public List<RoomInformation> getRoomByHotelId(Integer id) {
        return roomMapper.getRoomByHotelId(id);
    }

    @Override
    public void updateRoom(RoomInformation roomInformation) {
        roomMapper.updateRoom(roomInformation);
    }

}
